1. Field of the Invention
The present invention relates to coding apparatuses and methods, decoding apparatuses and methods, and program storage media therefor. More particularly, the present invention relates to a coding apparatus and method for coding audio data, a decoding apparatus and method for decoding coded data, and a program storage medium therefor.
2. Description of the Related Art
As techniques for compressing and coding audio data, ATRAC (trademark), MPEG (Moving Picture Experts Group)-1 Audio Layer 3 (hereinafter referred to as an “MP3”), etc., have come to be widely used in personal computers, etc.
Referring to FIG. 1, a conventional audio coding process using ATRAC (Adaptive Transform Acoustic Coding) is described. For example, as shown in part (A) of FIG. 1, in a case where input sequential audio data is to be coded in such a manner as to correspond to plural sequential musical pieces, the sequential audio data (corresponding to the tracks in the figure) is divided into blocks for each audio data (that is, for each musical piece), as shown in part (B) of FIG. 1.
Each audio data, as shown in part (C) of FIG. 1, is divided into orthogonal transform blocks composed of, for example, 1024 samples.
The coding process is performed based on the orthogonal transform block. For example, as shown in FIG. 2, a sound unit (hereinafter referred to as an “SU”) is created in such a manner as to correspond to an orthogonal transform block, and a coded stream (coded data) is formed. A header in which synchronization data, etc., is stored is added to the start of the coded stream.
When the position of the back end of the orthogonal transform block located at the end of each audio data does not match the track end position (the end position of the musical piece, that is, the end position of the audio data), as shown in part (D) of FIG. 1, data, which is “0”, is stored in the portions (portions after the track end position, where there is no data) after the orthogonal transform block located at the end of each audio data.
Referring to the flowchart shown in FIG. 3, a conventional coding process by a personal computer is described. In step S11, the personal computer computes the number of necessary SUs on the basis of the number of samples (the number of samples of the original data which is not coded) of the current audio data.
In step S12, the personal computer performs a coding process for each orthogonal transform block. In step S13, the personal computer determines whether or not the data is the last orthogonal transform block. When it is determined that the data is not the last orthogonal transform block, the process returns to step S12, and the coding process is repeated.
When it is determined in step S13 that the data is the last orthogonal transform block, the process proceeds to step S14, whereby the personal computer determines whether or not the track end position is contained in the middle of the orthogonal transform block.
When it is determined in step S14 that the track end position is contained in the middle of the orthogonal transform block, the personal computer sets “0” in portions of the orthogonal transform block after the track end position, and the process proceeds to step S16.
When it is determined in step S14 that the track end position is not contained in the middle of the orthogonal transform block, the process of step S15 is not necessary. Therefore, step S15 is skipped, and the process proceeds to step S16.
In step S16, the personal computer codes the last orthogonal transform block. In step S17, the personal computer performs a termination process, such as closing a file in which coded data is stored.
In step S18, the personal computer determines whether or not there is next audio data. When it is determined that there is next audio data, the process returns to step S11, and coding of the next audio data is performed.
When it is determined in step S18 that there is no next audio data, the processing is terminated.
However, when the track end position is contained in the middle of the orthogonal transform block, data of “0” is placed at the end of the orthogonal transform block and coding is performed. As a result, in the coded data obtained by being coded in this manner, as shown in FIG. 4, a no-audio interval occurs at the end of the musical piece.
In such coded data, for example, when plural musical pieces which are so-called “live-recorded”, in which audio is not interrupted and is in sequence, are to be played back, audio is interrupted at the end of the musical piece, thereby striking viewers and listeners as being incongruous.